package com.fr.chart;

import com.fr.base.XMLable;
import com.fr.base.background.Background;
import com.fr.base.core.json.JSONException;
import com.fr.base.core.json.JSONObject;
import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLableReader;
import com.fr.chart.base.equals.Equals;
import com.fr.chart.core.Shadow;
import java.awt.Color;

public abstract class ChartModule
  implements XMLable
{
  private static final long serialVersionUID = -7710020079813598300L;
  private GeneralInfo info = new GeneralInfo();

  public GeneralInfo getInfo()
  {
    return this.info;
  }

  public void setInfo(GeneralInfo paramGeneralInfo)
  {
    this.info = paramGeneralInfo;
  }

  public Background getBackground()
  {
    return this.info.getBackground();
  }

  public void setBackground(Background paramBackground)
  {
    this.info.setBackground(paramBackground);
  }

  public Shadow getShadow()
  {
    return this.info.shadow;
  }

  public void setShadow(Shadow paramShadow)
  {
    this.info.shadow = paramShadow;
  }

  public int getBorderStyle()
  {
    return this.info.getBorderStyle();
  }

  public void setBorderStyle(int paramInt)
  {
    this.info.setBorderStyle(paramInt);
  }

  public Color getBorderColor()
  {
    return this.info.getBorderColor();
  }

  public void setBorderColor(Color paramColor)
  {
    this.info.setBorderColor(paramColor);
  }

  public float getAlpha()
  {
    return this.info.getAlpha();
  }

  public void setAlpha(float paramFloat)
  {
    this.info.setAlpha(paramFloat);
  }

  public void setRoundBorder(boolean paramBoolean)
  {
    this.info.setRoundBorder(paramBoolean);
  }

  public boolean isRoundBorder()
  {
    return this.info.isRoundBorder();
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    if (this.info != null)
      this.info.writeXML(paramXMLPrintWriter);
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    if (paramXMLableReader.isChildNode())
    {
      String str = paramXMLableReader.getTagName();
      if ("GI".equals(str))
        this.info = ((GeneralInfo)paramXMLableReader.readXMLObject(new GeneralInfo()));
    }
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    ChartModule localChartModule = (ChartModule)super.clone();
    localChartModule.info = ((GeneralInfo)this.info.clone());
    return localChartModule;
  }

  public boolean equals(Object paramObject)
  {
    if (!(paramObject instanceof ChartModule))
      return false;
    ChartModule localChartModule = (ChartModule)paramObject;
    return (Equals.equals(localChartModule.getInfo(), getInfo()));
  }

  public JSONObject toJSONObject()
    throws JSONException
  {
    JSONObject localJSONObject = new JSONObject();
    if (this.info != null)
      localJSONObject.put("info", this.info.toJSONObject());
    return localJSONObject;
  }
}